package com.lnsf.bookstore.system.address.controller;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.common.util.StringUtil;
import com.lnsf.bookstore.system.address.service.AddressService;
import com.lnsf.bookstore.system.address.vo.Address;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/address")
public class AddressController {

    @Autowired
    private AddressService addressService;

    @RequestMapping("/v_list.do")
    public String list(HttpServletRequest request, ModelMap modelMap){
        System.out.println("category.....");
        return "admin/address/address";
    }

    /**
     * 查看所有列表
     */
    @RequestMapping(value = "/queryByUid",method = {RequestMethod.POST,RequestMethod.GET})
    @ResponseBody
    public Object queryByUid(@RequestParam Map<String, Object> params) {
        PageInfo<Address> pageInfo = addressService.queryByUid(params);
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("page",pageInfo);
        return map;
    }
	
	
	
	
	
}
